import Vue from 'vue'
import Router from 'vue-router'

const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}
// 页面
import Login from '@/pages/login/Login.vue'
import Home from '@/pages/home/Home.vue'
import Index from '@/pages/index/index.vue'

// 商品列表与详情
import GoodsList from '@/pages/goodsList/GoodsList.vue'
import GoodsDetail from '@/pages/goodsDetail/GoodsDetail.vue'
// 内容
import contentList from "@/pages/contentList/GoodsList.vue"
import GoodsAdd from '@/pages/goodsAdd/GoodsAdd.vue'
// 商品一级分类列表与详情
import FirstTypeList from '@/pages/firstTypeList/FirstTypeList.vue'
import FirstTypeDetail from '@/pages/firstTypeDetail/FirstTypeDetail.vue'
// 商品二级分类列表与详情
import SecondTypeList from '@/pages/secondTypeList/SecondTypeList.vue'
import SecondTypeDetail from '@/pages/secondTypeDetail/SecondTypeDetail.vue'
// 普通订单列表与详情
import OrderList from '@/pages/orderList/OrderList.vue'
import OrderDetail from '@/pages/orderDetail/OrderDetail.vue'
// 普通订单列表与详情
import SendOrderList from '@/pages/sendOrderList/SendOrderList.vue'
import SendOrderDetail from '@/pages/sendOrderDetail/SendOrderDetail.vue'
//普通用户列表
import UserList from '@/pages/userList/UserList.vue'
import UserDetail from '@/pages/userDetail/UserDetail.vue'
//活动列表和详情
import MealList from '@/pages/mealList/MealList.vue'
import RandomList from '@/pages/mealList/random.vue'
import MealDetail from '@/pages/mealDetail/MealDetail.vue'
import RandomDetail from '@/pages/mealDetail/RandomDetail.vue'
//活动列表和详情
import CouponList from '@/pages/couponList/CouponList.vue'
import CouponDetail from '@/pages/couponDetail/CouponDetail.vue'
import RandomCouponList from '@/pages/couponList/RandomList.vue'
//充值金额和详情
import RechargeList from '@/pages/rechargeList/RechargeList.vue'
import RechargeDetail from '@/pages/rechargeDetail/RechargeDetail.vue'
//充值订单列表
import RechargeOrderList from '@/pages/rechargeOrderList/RechargeOrderList.vue'
//账号管理
import NumberIndex from '@/pages/number/index.vue'
import Addaccount from "@/pages/number/Addaccount.vue"
//支付运费列表
import Freight from "@/pages/freight/index.vue"
//修改密码
import Changepassword from "@/pages/changepassword/index.vue"
//个人资料
import personal_info from "@/pages/personal_info/index.vue"
//审核列表
//品牌系列
import Brandreview from '@/pages/brandreview/index.vue'
import BrandreviewDetail from '@/pages/brandreview/detail.vue'
//内容中心、
import Contentreview from '@/pages/contentreview/index.vue'
import ContentreviewDetail from '@/pages/contentreview/detail.vue'
//认证审核
import Certificationaudit from '@/pages/Certificationaudit/index.vue'
import CertificationauditDetail from '@/pages/Certificationaudit/detail.vue'
//提交认证
import Certification from '@/pages/Certification/index.vue'
//推荐活动
import Activity from '@/pages/activity/index.vue'
import activityDetail from '@/pages/activity/detail.vue'
import listDetail from '@/pages/activity/list_detail.vue'
import activityList from '@/pages/activity/activity_list.vue'
//财务管理
//财务统计
import Financialstatistics from '@/pages/financialstatistics/index.vue'
import FinancialstatisticsDetail from '@/pages/financialstatistics/detail.vue'
//账户管理
import Accountsettings from '@/pages/accountsettings/index.vue'
import AccountsettingsDetail from '@/pages/accountsettings/detail.vue'
//用户余额列表
import userBalanceList from '@/pages/userBalanceList/index.vue'
import userBalanceListDetail from '@/pages/userBalanceList/detail.vue'
import Comment from '@/pages/comment/index.vue'
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/login',
      name: 'Login',
      component: Login
    },
    {
      path: '/',
      component: Home,
      children: [
        {
          path: '/',
          name: 'index',
          component: Index
        },
        {
          path: '/goodsList',
          name: 'GoodsList',
          component: GoodsList
        },
        {
          path: '/goodsList/goodsDetail/:id',
          name: 'GoodsDetail',
          component: GoodsDetail
        },
        {
          path: '/contentList',
          name: 'ContentList',
          component: contentList
        },
        {
          path: '/goodsAdd',
          name: 'GoodsAdd',
          component: GoodsAdd
        },
        {
          path: '/firstTypeList',
          name: 'FirstTypeList',
          component: FirstTypeList
        },
        {
          path: '/firstTypeList/firstTypeDetail/:id/:company/:login_id',
          name: 'FirstTypeDetail',
          component: FirstTypeDetail
        },
        {
          path: '/secondTypeList',
          name: 'SecondTypeList',
          component: SecondTypeList
        },
        {
          path: '/secondTypeList/SecondTypeDetail/:id/:fication/:companyId',
          name: 'SecondTypeDetail',
          component: SecondTypeDetail
        },
        {
          path: '/orderList',
          name: 'OrderList',
          component: OrderList
        },
        {
          path: '/orderList/orderDetail/:id',
          name: 'OrderDetail',
          component: OrderDetail
        },
        {
          path: '/sendOrderList',
          name: 'SendOrderList',
          component: SendOrderList
        },
        {
          path: '/sendOrderList/sendOrderDetail/:id',
          name: 'SendOrderDetail',
          component: SendOrderDetail
        },
        {
          path: '/userList',
          name: 'UserList',
          component: UserList
        },
        {
          path: '/userList/userDetail/:id',
          name: 'UserDetail',
          component: UserDetail
        },
        {
          path: '/mealList',
          name: 'MealList',
          component: MealList
        },
        {
          path:'/RandomList',
          name:'RandomList',
          component:RandomList
        },
        {
          path: '/mealList/mealDetail/:id',
          name: 'MealDetail',
          component: MealDetail
        },
        {
          path: '/RandomList/RandomDetail/:id',
          name: 'RandomDetail',
          component: RandomDetail
        },
        {
          path: '/mealList/couponList/:id/:name',
          name: 'CouponList',
          component: CouponList
        },
        {
          path: '/RandomList/RandomCouponList/:id/:name/:many',
          name: 'RandomCouponList',
          component: RandomCouponList
        },
        {
          path: '/mealList/couponList/couponDetail',
          name: 'CouponDetail',
          component: CouponDetail
        },
        {
          path: '/rechargeList',
          name: 'RechargeList',
          component: RechargeList
        },
        {
          path: '/rechargeList/rechargeDetail/:id',
          name: 'RechargeDetail',
          component: RechargeDetail
        },
        {
          path: '/rechargeOrderList',
          name: 'RechargeOrderList',
          component: RechargeOrderList
        },
        {
          path: '/number',
          name: 'number',
          component: NumberIndex
        },
        {
          path:'/Addaccount/:id',
          name:'Addaccount',
          component:Addaccount
        },
        {
          path:'/Freight',
          name:'Freight',
          component:Freight
        },
        {
          path:'/personalinfo/changepassword',
          name:'changepassword',
          component:Changepassword
        },
        {
          path:'/brandreview',
          name:'Brandreview',
          component:Brandreview
        },
        {
          path: '/brandreview/detail/:id/:fication/:companyId',
          name: 'BrandreviewDetail',
          component: BrandreviewDetail
        },
        {
          path:'/contentreview',
          name:'Contentreview',
          component:Contentreview
        },
        {
          path:'/contentreview/detail',
          name:'ContentreviewDetail',
          component:ContentreviewDetail
        },
        {
          path:'/certificationaudit',
          name:'certificationaudit',
          component:Certificationaudit
        },
        {
          path:'/certificationaudit/detail/:id',
          name:'CertificationauditDetail',
          component:CertificationauditDetail
        },
        {
          path:'/personalinfo/certification',
          name:'certification',
          component:Certification
        },
        {
          path:'/activity',
          name:'activity',
          component:Activity
        },
        {
          path:'/activity/activityDetail/:id',
          name:'activityDetail',
          component:activityDetail
        },
        {
          path:'/financialstatistics',
          name:'financialstatistics',
          component:Financialstatistics
        },
        {
          path:'/accountsettings',
          name:'accountsettings',
          component:Accountsettings
        },
        {
          path:'/personalinfo/accountsettings/detail/:id',
          name:'accountsettingsdetail',
          component:AccountsettingsDetail
        },
        {
          path:'/financialstatistics/detail',
          name:'financialstatisticsDetail',
          component:FinancialstatisticsDetail
        },
        {
          path:'/personalinfo',
          name:'personalinfo',
          component:personal_info
        },
        {
          path:'/userBalanceList',
          name:'userBalanceList',
          component:userBalanceList
        },
        {
          path:'/userBalanceList/detail',
          name:'userBalanceListDetail',
          component:userBalanceListDetail
        },
        {
          path:'/activity/listDetail/:activity/:id',
          name:'activityListDetail',
          component:listDetail
        },
        {
          path:'/activity/activityList/:id',
          name:'activityList',
          component:activityList
        },
        {
          path:'/comment',
          name:'comment',
          component:Comment
        }
      ]
    }
    // {
    //   path: '/about',
    //   name: 'about',
    //   // route level code-splitting
    //   // this generates a separate chunk (about.[hash].js) for this route
    //   // which is lazy-loaded when the route is visited.
    //   component: () => import(/* webpackChunkName: "about" */ './views/About.vue')
    // }
  ]
})
